﻿@model IdentityResourceViewModel
@using UHub.Web.Models.IdentityResource

@{ }

<div class="card">
	<div class="card-body">
		<div class="btn-group">
			<a type="button" class="btn btn-primary" asp-controller="IdentityResource" asp-action="Index">返回</a>
		</div>
		@if (Model != null)
		{
			<form>
				<div class="form-group row">
					<label class="col-sm-3 col-form-label">Id</label>
					<div class="col-sm-9">
						<input type="text" readonly class="form-control-plaintext" value="@Model.Id">
					</div>
				</div>
				<div class="form-group row">
					<label class="col-sm-3 col-form-label">Name</label>
					<div class="col-sm-9">
						<input type="text" readonly class="form-control-plaintext" value="@Model.Name">
					</div>
				</div>
				<div class="form-group row">
					<label class="col-sm-3 col-form-label">显示名</label>
					<div class="col-sm-9">
						<input type="text" readonly class="form-control-plaintext" value="@Model.DisplayName">
					</div>
				</div>
				<div class="form-group row">
					<label class="col-sm-3 col-form-label">描述</label>
					<div class="col-sm-9">
						<input type="text" readonly class="form-control-plaintext" value="@Model.Description">
					</div>
				</div>
				<div class="form-group">
					<label>UserClaims</label>
					<div>
						@foreach (var item in Model.UserClaims)
						{
							<span class="badge badge-secondary">@item</span>
						}
					</div>
				</div>
				<div class="form-group row">
					<label class="col-sm-3 col-form-label">必需</label>
					<div class="col-sm-9">
						<input type="text" readonly class="form-control-plaintext" value="@(Model.Required ? "是" : "否")">
					</div>
				</div>
				<div class="form-group row">
					<label class="col-sm-3 col-form-label">在发现文档显示</label>
					<div class="col-sm-9">
						<input type="text" readonly class="form-control-plaintext" value="@(Model.ShowInDiscoveryDocument ? "是" : "否")">
					</div>
				</div>
				<div class="form-group row">
					<label class="col-sm-3 col-form-label">创建时间</label>
					<div class="col-sm-9">
						<input type="text" readonly class="form-control-plaintext" value="@Model.CreateTime">
					</div>
				</div>
				<div class="form-group row">
					<label class="col-sm-3 col-form-label">最后更新时间</label>
					<div class="col-sm-9">
						<input type="text" readonly class="form-control-plaintext" value="@Model.LastUpdateTime">
					</div>
				</div>
			</form>
		}
		else
		{
			<div class="alert alert-danger" role="alert">找不到此身份资源</div>
		}
	</div>
</div>
